<template>
  <el-select :value="value" placeholder="请选择货区类型" style="width: 100%;" @change="updavalue">
    <el-option
      v-for="item in Hqtype"
      :key="item.Id"
      :label="item.Name"
      :value="item.Name"
    />
  </el-select>
</template>
<script>
import { getHqtype } from '@/api/huoqu'
export default {
  props: {
    value: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      Hqtype: [{}]
    }
  },
  created() {
    this.gethuoqutype()
  },
  methods: {
    async gethuoqutype() {
      const res = await getHqtype()
      this.Hqtype = res.EnumItems
      console.log('son获取获取类型', this.Hqtype)
    },
    updavalue(val) {
      console.log('子组件的值', val)
      this.$emit('input', val)
    }
  }
}
</script>
